package com.academico.web.servlet.disciplina;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.academico.dao.DisciplinaDAO;
import com.academico.model.Disciplina;
import com.academico.web.servlet.BaseServlet;

public class PopulateDisciplinaServlet extends BaseServlet {

	private static final long serialVersionUID = 1610922054520014783L;

	@Override
	public void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		DisciplinaDAO disciplinaDAO = new DisciplinaDAO();
		List<Disciplina> disciplinas = disciplinaDAO.findAll();
		request.setAttribute("disciplinas", disciplinas);
		forward("disciplina.jsp", request, response);
		
	}

}
